package com.itls.recommendedgames.entity;


import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;

public class UserLibraryGameDTO {
    private Integer id;
    private String name;
    private String image;
    private BigDecimal playTime;
    private LocalDateTime lastPlayed;
    private List<String> tags;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public BigDecimal getPlayTime() {
        return playTime;
    }

    public void setPlayTime(BigDecimal playTime) {
        this.playTime = playTime;
    }

    public LocalDateTime getLastPlayed() {
        return lastPlayed;
    }

    public void setLastPlayed(LocalDateTime lastPlayed) {
        this.lastPlayed = lastPlayed;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    // 添加处理 tagsStr 字段的方法
    public void setTagsStr(String tagsStr) {
        if (tagsStr != null && !tagsStr.isEmpty()) {
            this.tags = Arrays.asList(tagsStr.split(","));
        }
    }
}